package com.github.jspxnet.worktask.model.enums;

import com.github.jspxnet.enums.EnumType;

/**
 * Created by jspx.net
 *
 * author: chenYuan
 * date: 2020/9/9 0:00
 * description: jspbox
 **/
public enum JobEnumType implements EnumType {

    //比如 站内提醒 短信提醒 联动等，主动发起请求
    THIRD(8, "第三方触发"),

    //回调触发一个接口去实现短信等功能
    CLassJob(7, "java类回调"),
    //回调触发一个接口去实现短信等功能
    HTTP(6, "http回调"),

    SCRIPT(5, "脚本控制"),

    SIGN(4, "签收"),

    COPY(3, "抄送"),
    //所有
    AND(2, "会签"),

    //有人数 默认为1
    OR(1, "或签"),

    NONE(0, "无动作");

    private final int value;
    private final String name;

    JobEnumType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    static public JobEnumType find(int value) {
        for (JobEnumType c : JobEnumType.values()) {
            if (c.value == value) {
                return c;
            }
        }
        return JobEnumType.NONE;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getName() {
        return this.name;
    }

}
